home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13589 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.8 KB

  1. Path: mail2news.demon.co.uk!genesis.demon.co.uk
  2. From: Lawrence Kirby <fred@genesis.demon.co.uk>
  3. Newsgroups: comp.lang.c,comp.lang.c++,comp.object,comp.software-eng
  4. Subject: Re: Beware of "C" Hackers -- A rebuttal to Bertrand Meyer
  5. Date: Tue, 26 Mar 96 12:27:13 GMT
  6. Organization: none
  7. Message-ID: <827843233snz@genesis.demon.co.uk>
  8. References: <1995Jul3.034108.4193@rcmcon.com> <3154A548.71FF@iadfw.net> <4j3p80INN567@keats.ugrad.cs.ubc.ca> <3155786F.1262@iadfw.net> <4j4hc5INNct5@keats.ugrad.cs.ubc.ca> <3155D8B2.6879@iadfw.net>
  9. Reply-To: fred@genesis.demon.co.uk
  10. X-NNTP-Posting-Host: genesis.demon.co.uk
  11. X-Newsreader: Demon Internet Simple News v1.27
  12. X-Mail2News-Path: genesis.demon.co.uk
  13.  
  14. In article <3155D8B2.6879@iadfw.net> lfw@iadfw.net "Larry Weiss" writes:
  15.  
  16. >Kazimir Kylheku wrote:
  17. > > 
  18. > > >Kazimir Kylheku wrote:
  19. > > > >  this I think is a major flaw in the otherwise great book. 
  20. > > 
  21. > > The book is a classic work, so it might as well be left alone, with its few
  22. > > minor warts and all.
  23. >
  24. >So, which is it?  "major" or "minor" ?
  25.  
  26. IMHO minor because it is not leading you on to write poor or non-conforming
  27. C code. By comparison the bad description of scanf and invalid redefinition
  28. of standard library functions in examples are much more serious. I've
  29. criticised Schildt in the past for leading by bad example; where K&R do the
  30. same they deserve the same criticism.
  31.  
  32. >I don't want to allow this to pass so casually.   K&R are certainly selling
  33. >a bunch of books to people on the premise that they have expertise in the
  34. >subject.
  35.  
  36. There is no doubt that they do. The problem is in assuming that they are
  37. perfect which, as far as standard C is concerned, they are clearly not.
  38. However they make few mistakes compared to most other authors.
  39.  
  40. >   If they make fundamental errors in their text (and I'm starting
  41. >to believe that they are, in fact, misrepresenting the language C with respect
  42. >to the standard library) then we should shed some light on these mistakes
  43. >and maybe influence the next revision.
  44.  
  45. I suspect that the full ANSI version of K&R2 was rushed. I'm sure K&R like
  46. everybody else understand the implications of the ANSI standard much more
  47. now than they did then. There are certainly errors in K&R2 that warrant
  48. revision.
  49.  
  50. >This is exactly why I started this discussion.  I am now even more convinced
  51. >that most programmers do not even yet understand the implications of some of
  52. >the most important decisions of the C Standardization effort.
  53.  
  54. There are 3 categories of function you can call:
  55.  
  56. 1. Functions that are well defined by the C language because you have
  57.    the source code
  58.  
  59. 2. Functions that are defined by the language itself i.e. standard library
  60.    functions.
  61.  
  62. 3. 'Other library' functions. Calling these results in undefined behaviour
  63.    as far as the C language is concerned (or you had already invoked
  64.    undefined behaviour by including a non-standard header file).
  65.  
  66. The only things special about standard library functions are that
  67. they are guaranteed to exist with well-defined semantics in any conforming
  68. hosted implementation, and that certain identifiers are reserved. So long
  69. as you understand the rules it doesn't make a practical difference whether
  70. you consider the standard library to be part of the language or not -
  71. indeed a (freestanding) C language implementation can exist without the
  72. standard library.
  73.  
  74. However saying that the standard library is not a part of the language is
  75. certainly going against the grain and I don't think it is a helpful. And of
  76. course it is a simple position to take that anything defined in ISO/IEC
  77. 9899-1990 is part of the C language. It guess it boils down to what you
  78. mean by "the C language" (which is quite important to a newsgroup
  79. called comp.lang.c!)
  80.  
  81. -- 
  82. -----------------------------------------
  83. Lawrence Kirby | fred@genesis.demon.co.uk
  84. Wilts, England | 70734.126@compuserve.com
  85. -----------------------------------------
  86.